﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EnergyConsumptionDevelopmentSettings.aspx.cs"
    Inherits="RCREEE.Web.EnergyConsumptionDevelopmentSettings" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" %>

<%--<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">--%>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="scriptMan" runat="server">
    </asp:ScriptManager>
    <div id="dialogContent" style="font-size: small">
        <p>
            Are you sure you want to delete?</p>
    </div>
    <asp:UpdateProgress ID="Up1" runat="Server" AssociatedUpdatePanelID="updatePanel1">
        <ProgressTemplate>
            <div class="progressBackgroundFilter">
            </div>
            <div class="processMessage">
                Loading...<br />
                <br />
                <img alt="Loading..." src="Images/Loading.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div>
                <asp:TreeView ID="tvMasterItems" runat="server" meta:resourcekey="tvMasterItemsResource1">
                    <SelectedNodeStyle BackColor="#0099FF" ForeColor="White" />
                </asp:TreeView>
                <br />
                <asp:Button ID="btnAddItem" runat="server" OnClick="btnAddItem_Click" Text="Add"
                    meta:resourcekey="btnAddItemResource1" />
                <asp:HiddenField ID="hiddenSelectedNodeId" runat="server" />
                <asp:FormView ID="fvMasterEnergyConsumptions" runat="server" DataSourceID="odsMasterEnergyConsumptions"
                    EnableModelValidation="True" DataKeyNames="ItemId,LanguageCode" OnItemUpdated="fvMasterEnergyConsumptions_ItemUpdated"
                    OnDataBound="fvMasterEnergyConsumptions_DataBound" OnItemUpdating="fvMasterEnergyConsumptions_ItemUpdating"
                    OnItemInserted="fvMasterEnergyConsumptions_ItemInserted" OnItemInserting="fvMasterEnergyConsumptions_ItemInserting"
                    meta:resourcekey="fvMasterEnergyConsumptionsResource1" Width="50%" OnItemDeleted="fvMasterEnergyConsumptions_ItemDeleted">
                    <ItemTemplate>
                        <asp:Panel ID="pnlItemTemplateEnglish" runat="server" GroupingText="Details" meta:resourcekey="pnlItemTemplateResource1">
                            <asp:Panel ID="pnlEnglishItemTemplate" runat="server" BorderStyle="None">
                                <table id="englishItemTemplate">
                                    <tr>
                                        <td class="style5">
                                            <asp:Label ID="lblEnglishItemName" runat="server" Text="Item Name:" />
                                        </td>
                                        <td class="style17">
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("EnglishItemName") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style5">
                                            <asp:Label ID="Label3" runat="server" Text="Description:" />
                                        </td>
                                        <td class="style17">
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("EnglishDescription") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlFrenchItemTemplate" runat="server" BorderStyle="None">
                                <table id="Table1">
                                    <tr>
                                        <td class="style5">
                                            <asp:Label ID="Label5" runat="server" Text="Item Name:" />
                                        </td>
                                        <td class="style18">
                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("FrenchItemName") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style5">
                                            <asp:Label ID="Label7" runat="server" Text="Description:" />
                                        </td>
                                        <td class="style18">
                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("FrenchDescription") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlArabicDescription" runat="server" BorderStyle="None">
                                <table>
                                    <tr>
                                        <td class="style15">
                                            <asp:Label ID="Label9" runat="server" Text="Item Name:" />
                                        </td>
                                        <td class="style19">
                                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("ArabicItemName") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style15">
                                            <asp:Label ID="Label11" runat="server" Text="Description:" />
                                        </td>
                                        <td class="style19">
                                            <asp:Label ID="Label12" runat="server" Text='<%# Bind("ArabicDescription") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <table id="tblItemTempltate" runat="server" meta:resourcekey="tblItemTempltateResource1">
                                <tr visible="False" runat="server" meta:resourcekey="TableRowResource1">
                                    <td runat="server" meta:resourcekey="TableCellResource1" class="style16">
                                        <asp:Label ID="lblItemId" runat="server" Text="Item Id" meta:resourcekey="lblItemIdResource1" />
                                    </td>
                                    <td runat="server" meta:resourcekey="TableCellResource2" class="style20">
                                        <asp:Label ID="lblItemIdValue" runat="server" Text='<%# Eval("ItemId") %>' meta:resourcekey="lblItemIdValueResource1"></asp:Label>
                                    </td>
                                </tr>
                                <tr runat="server" meta:resourcekey="TableRowResource3">
                                    <td runat="server" meta:resourcekey="TableCellResource5" class="style16">
                                        <asp:Label ID="lblIsMajor" runat="server" Text="Major Item:" meta:resourcekey="lblIsMajorResource2" />
                                    </td>
                                    <td runat="server" meta:resourcekey="TableCellResource6" class="style20">
                                        <asp:CheckBox ID="chkIsMajor" runat="server" Checked='<%# Bind("IsMajor") %>' Enabled="False"
                                            meta:resourcekey="chkIsMajorResource2"></asp:CheckBox>
                                    </td>
                                </tr>
                                <tr runat="server" meta:resourcekey="TableRowResource4">
                                    <td runat="server" meta:resourcekey="TableCellResource7" class="style16">
                                        <asp:Label ID="Label2" runat="server" Text="Parent Item:" meta:resourcekey="Label2Resource3" />
                                    </td>
                                    <td runat="server" meta:resourcekey="TableCellResource8" class="style20">
                                        <asp:Label ID="lblParentItem" runat="server" Text='<%# Bind("ParentItemName") %>'
                                            meta:resourcekey="lblParentItemResource1" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Button ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                            Text="Edit" meta:resourcekey="EditButtonResource1"></asp:Button>
                        <asp:Button ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="Delete" meta:resourcekey="DeleteButtonResource1" OnClientClick="javascript:return openDeletePopup(this.name);">
                        </asp:Button>
                        <asp:Button ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                            Text="New" meta:resourcekey="NewButtonResource1"></asp:Button>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Panel ID="pnlEditTemplate" runat="server" GroupingText="Details" meta:resourcekey="pnlEditTemplateResource1">
                            <asp:Label ID="lblItemIdValue_Edit" runat="server" Text='<%# Eval("ItemId") %>' Visible="False"
                                meta:resourcekey="lblItemIdValue_EditResource1"></asp:Label>
                            <br />
                            <asp:Panel ID="pnlEnglishEdit" runat="server" GroupingText="English">
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblItemName" runat="server" Text="Item Name: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtItemName_Edit" runat="server" Text='<%# Bind("EnglishItemName") %>'
                                                Width="175px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="vldEnglishName_Edit" runat="server" ControlToValidate="txtItemName_Edit"
                                                ErrorMessage="English Name">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label13" runat="server" Text="Description: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Text='<%# Bind("EnglishDescription") %>'
                                                Height="50px"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <asp:Panel ID="pnlFrenchEdit" runat="server" GroupingText="French">
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label14" runat="server" Text="Item Name: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtFrenchName_Edit" runat="server" Text='<%# Bind("FrenchItemName") %>'
                                                Width="175px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="vldFrenchName_Edit" runat="server" ControlToValidate="txtFrenchName_Edit"
                                                ErrorMessage="French Name">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label15" runat="server" Text="Description: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox3" runat="server" TextMode="MultiLine" Text='<%# Bind("FrenchDescription") %>'
                                                Height="50px"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <asp:Panel ID="pnlArabicEdit" runat="server" GroupingText="Arabic">
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label16" runat="server" Text="Item Name: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtArabicName_Edit" runat="server" Text='<%# Bind("ArabicItemName") %>'
                                                Width="175px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="vldArabicName_Edit" runat="server" ControlToValidate="txtArabicName_Edit"
                                                ErrorMessage="Arabic Name">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label17" runat="server" Text="Description: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox5" runat="server" TextMode="MultiLine" Text='<%# Bind("ArabicDescription") %>'
                                                Height="50px"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <table>
                                <tr>
                                    <td colspan='2'>
                                        <asp:CheckBox ID="chkIsMajor" runat="server" Text="Major Item" Checked='<%# Bind("IsMajor") %>'
                                            meta:resourcekey="chkIsMajorResource1"></asp:CheckBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan='2'>
                                        <hr />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label2" runat="server" Text="Parent Item: " meta:resourcekey="Label2Resource1" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblParentItem_Edit" runat="server" Text='<%# Bind("ParentItemName") %>'
                                            meta:resourcekey="lblParentItem_EditResource1" />
                                        <asp:Label ID="lblParentItemId_Edit" runat="server" Text='<%# Bind("ParentItemId") %>'
                                            Visible="False" meta:resourcekey="lblParentItemId_EditResource1"></asp:Label>
                                        <asp:TreeView ID="tvParentItems_Edit" runat="server" OnSelectedNodeChanged="tvParentItems_Edit_SelectedNodeChanged"
                                            meta:resourcekey="tvParentItems_EditResource1">
                                            <SelectedNodeStyle BackColor="#0099FF" ForeColor="White" />
                                        </asp:TreeView>
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <asp:Button ID="btnClearParent" runat="server" Text="Clear Parent" OnClick="btnClearParent_Click"
                                meta:resourcekey="btnClearParentResource1" />
                            <br />
                        </asp:Panel>
                        <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update" Text="Update"
                            meta:resourcekey="UpdateButtonResource1"></asp:LinkButton>
                        <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="Cancel" meta:resourcekey="UpdateCancelButtonResource1"></asp:LinkButton>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:Panel ID="pnlInsertTemplate" runat="server" GroupingText="Details" meta:resourcekey="pnlInsertTemplateResource1">
                            <br />
                            <asp:Panel ID="pnlEnglishInsert" runat="server" GroupingText="English">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblItemName" runat="server" Text="Item Name: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtEnglishName_Insert" runat="server" Text='<%# Bind("EnglishItemName") %>'
                                                Height="21px" Width="175px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="vldEnglishNmae_Insert" runat="server" ControlToValidate="txtEnglishName_Insert"
                                                ErrorMessage="English Name">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label13" runat="server" Text="Description: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Text='<%# Bind("EnglishDescription") %>'
                                                Height="50px"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <asp:Panel ID="pnlFrenchInsert" runat="server" GroupingText="French">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label14" runat="server" Text="Item Name: " />
                                        </td>
                                        <td class="style22">
                                            <asp:TextBox ID="txtFrenchName_Insert" runat="server" Text='<%# Bind("FrenchItemName") %>'
                                                Height="21px" Width="175px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="vldFrenchNmae_Insert" runat="server" ControlToValidate="txtFrenchName_Insert"
                                                ErrorMessage="French Name">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label15" runat="server" Text="Description: " />
                                        </td>
                                        <td class="style22">
                                            <asp:TextBox ID="TextBox3" runat="server" TextMode="MultiLine" Text='<%# Bind("FrenchDescription") %>'
                                                Height="50px"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <asp:Panel ID="pnlArabicInsert" runat="server" GroupingText="Arabic">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label16" runat="server" Text="Item Name: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtArabicName_Insert" runat="server" Text='<%# Bind("ArabicItemName") %>'
                                                Height="22px" Width="175px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="vldArabicNmae_Insert" runat="server" ControlToValidate="txtArabicName_Insert"
                                                ErrorMessage="Arabic Name">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label17" runat="server" Text="Description: " />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox5" runat="server" TextMode="MultiLine" Text='<%# Bind("ArabicDescription") %>'
                                                Height="50px"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <table>
                                <tr>
                                    <td colspan='2'>
                                        <asp:CheckBox ID="chkIsMajor_Insert" runat="server" Text="Major Item" Checked='<%# Bind("IsMajor") %>'
                                            meta:resourcekey="chkIsMajor_InsertResource1"></asp:CheckBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan='2'>
                                        <hr />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label2" runat="server" Text="Parent Item: " meta:resourcekey="Label2Resource2" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblParentItemName_Insert" runat="server" meta:resourcekey="lblParentItemName_InsertResource1" />
                                        <asp:TreeView ID="tvParentItems_Insert" runat="server" OnSelectedNodeChanged="tvParentItems_Insert_SelectedNodeChanged"
                                            meta:resourcekey="tvParentItems_InsertResource1">
                                            <SelectedNodeStyle BackColor="#0099FF" ForeColor="#FFFFCC" />
                                        </asp:TreeView>
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <asp:Button ID="btnClearParent_Insert" runat="server" Text="Clear Parent" OnClick="btnClearParent_Insert_Click"
                                meta:resourcekey="btnClearParent_InsertResource1" />
                        </asp:Panel>
                        <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert" Text="Insert"
                            meta:resourcekey="InsertButtonResource1"></asp:LinkButton>
                        <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="Cancel" meta:resourcekey="InsertCancelButtonResource1"></asp:LinkButton>
                    </InsertItemTemplate>
                </asp:FormView>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Required field(s) :"
                    meta:resourcekey="ValidationSummary1Resource1" />
                <br />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="odsMasterEnergyConsumptions" runat="server" DataObjectTypeName="RCREEE.Library.Entities.EnergyConsumptionDevelopmentItemValue"
        DeleteMethod="DeleteEnergyConsumptionDevelopmentItem" InsertMethod="Insert" SelectMethod="GetOneMasterEnergyConsumptionById"
        TypeName="RCREEE.Library.Entities.EnergyConsumptionDevelopmentItemValue" UpdateMethod="UpdateMasterEnergyConsumption">
        <SelectParameters>
            <asp:ControlParameter ControlID="tvMasterItems" Name="itemId" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:SessionParameter Name="LanguageCode" SessionField="LanguageCode" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
<%--    </form>
</body>
</html>--%>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="head">
    <div id="header">
        <div id="section">
            <table width="100%">
                <tr>
                    <td width="25%" align="center" valign="middle">
                        <img src="Images/LogoRCREEE_Transparent.png" width="200px"/>
                    </td>
                    <td width="50%" align="center">
                        <asp:Label ID="lbl_header_center" runat="server" Text="دليل إمكانيات الدول العربية<br/>في<br />مجالات الطاقة المتجددة و رفع كفاءة إنتاج و إستهلاك الطاقة"
                            Font-Bold="True" Font-Size="X-Large" Style="font-weight: bolder; color: #FFFFFF;
                            font-size: x-large; width: 100%; text-align: center;" meta:resourcekey="lbl_header_centerResource1">
                        </asp:Label>
                    </td>
                    <td width="25%" align="center" valign="middle">
                        <img src="Images/las-logo.png" width="100px" />
                    </td>
                </tr>
            </table>
        </div>
        <ul>
            <li><a href="Default.aspx">Home</a></li>
            <li><a href="Index.aspx">Index</a></li>
            <li><a href="Topics.aspx">Topics</a></li>
            <li><a href="CountrySelector.aspx">Countries</a></li>
            <li><a href="Aboutus.aspx">About Us</a></li>
            <li><a href="contactus.aspx">Contact us</a></li>
        </ul>
    </div>
    <style type="text/css">
        .style5
        {
            width: 107px;
        }
        .style15
        {
            width: 104px;
        }
        .style16
        {
            width: 121px;
        }
        .style17
        {
            width: 230px;
        }
        .style18
        {
            width: 239px;
        }
        .style19
        {
            width: 235px;
        }
        .style20
        {
            width: 214px;
        }
        .style21
        {
            width: 241px;
        }
        .style22
        {
            width: 246px;
        }
        .style23
        {
            width: 244px;
        }
    </style>
    <script type="text/javascript">
        $().ready(function () {
            $('#dialogContent').dialog({
                autoOpen: false,
                modal: true,
                bgiframe: true,
                title: "Confirm Delete",
                width: 300,
                height: 200
            });
        });

        function openDeletePopup(uniqueID) {
            debugger;
            $('#dialogContent').dialog('option', 'buttons',
                {
                    "OK": function () { debugger; __doPostBack(uniqueID, ''); $(this).dialog("close"); },
                    "Cancel": function () { $(this).dialog("close"); }
                });

            $('#dialogContent').dialog('open');

            return false;
        }
    </script>
</asp:Content>
